package mv.main;

import java.util.List;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

/**
 * Class description...
 *
 * @author Gantz
 */
public class MObject {
  protected void print(Object o){
    System.out.println(this.getClass().getSimpleName() + ": " + o);
  }

  protected void err(String message){
    throw new IllegalStateException(message);
  }

  protected static <T extends Object> List<T> toList(T... elements) {
    ArrayList<T> results = new ArrayList<T>();
    for (T e : elements) {
      results.add(e);
    }
    return results;
  }

  protected static String getInput(String name) {
    System.out.print("Enter " + name + " and press Enter: ");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try {
      return br.readLine();
    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
  }
}
